package top.huntwolf.admin.dao;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import top.huntwolf.admin.pojo.Subject;

import java.util.List;

@Mapper
@Repository
public interface SubjectDao {
    Subject FindSubject( Subject subject);


    void save(Subject subject);

    List<Subject> FindFirstList();

    List<Subject> FindSecondList();

    Subject findSubjectByTitle(String title);

    List<Subject> getHotSort(Integer limit);

    Subject findSubjectBySubjectId(Integer subjectId);

    // 查询书本或分类时使用此接口实现修改sort
    void updateSubjectSort(Subject subject);

    // 撤销热门搜索标签
    void removeHotSort(Integer subjectId);

    // 数据量不够时，后台指定热搜标签
    void addHotSort(@Param("list") List<Subject> list);

    // 后台批量修改热门搜索
    void updateSubjectSorts(List<Subject> list);

    void updateSubject(Subject subject);

    void deleteSubject(int subjectId);
}
